<template>
  <div class="loginwin">
    <div class="title">
      <h1>Log in</h1>
      <el-form :model="emp" label-width="auto" style="max-width: 600px">
        <el-form-item label="Name" :label-position="itemLabelPosition">
          <el-input v-model="emp.empno" />
        </el-form-item>
        <el-form-item label="Activity zone" :label-position="itemLabelPosition">
          <el-input v-model="emp.logpwd" />
        </el-form-item>
        <el-form-item>
          <el-button type="primary" @click="onSubmit">Create</el-button>
          <el-button>Cancel</el-button>
        </el-form-item>
      </el-form>
    </div>
  </div>
</template>

<script setup>
import { reactive, ref } from 'vue'
import { useEmpStore } from '../../stores/emp.js'
import { storeToRefs } from 'pinia'

const empStroe = useEmpStore()
const { emp } = storeToRefs(empStroe)

const labelPosition = ref('right')
const itemLabelPosition = ref('Left')

const onSubmit = () => {
  // console.log(emp.value)
  empStroe.login()
}
</script>

<style lang="scss" scoped>
.loginwin {
  width: 600px;
  height: 400px;
  background-color: pink;
  border-radius: 8px;
  .title {
    h1 {
      margin-left: 48px;
      font-size: 48px;
      font-weight: 800;
      line-height: 128px;
    }
  }
}
</style>
